package com.cssw.fyzb.core.dao.acct;

import com.cssw.fyzb.core.model.dodb.AcctTransfer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
public class AcctTransferDaoImpl implements AcctTransferDao {

    @Override
    public Long addLog(String acctType, Long fromUserId, Long toUserId, BigDecimal amount, String remark) {
        AcctTransfer acctTransfer = new AcctTransfer();
        acctTransfer.setAcctType(acctType);
        acctTransfer.setFromUserId(fromUserId);
        acctTransfer.setToUserId(toUserId);
        acctTransfer.setAmount(amount);
        acctTransfer.setRemark(remark);
        acctTransfer.save();
        return acctTransfer.getTransferId();
    }
}
